package cn.fastoo.web.backstage.param;

/**
 * jQuery-EasyUI:DataGrid数据表格请求参数
 * 
 * @author LP
 * 
 */
public class DataGridParam {
	/**
	 * 当前页数
	 */
	private Integer page;
	/**
	 * 每页显示数量
	 */
	private Integer rows;
	/**
	 * 排序的字段
	 */
	private String sort;
	/**
	 * 排序规则asc或desc
	 */
	private String order;

	public Integer getPage() {
		return page - 1;// org.springframework.data.domain.PageRequest索引从0开始
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public Integer getRows() {
		return rows;
	}

	public void setRows(Integer rows) {
		this.rows = rows;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getOrder() {
		return order.toUpperCase();
	}

	public void setOrder(String order) {
		this.order = order;
	}

	@Override
	public String toString() {
		return "DataGridParam [page=" + page + ", rows=" + rows + ", sort=" + sort + ", order=" + order + "]";
	}

}
